aux_source_directory(../Utils/General SRC_UTILS_GENERAL)
aux_source_directory(../Utils/General/BBox SRC_UTILS_GENERAL_BBOX)
aux_source_directory(../Utils/XML SRC_UTILS_XML)
aux_source_directory(../Utils/Math/Topology SRC_UTILS_TOPOLOGY)
aux_source_directory(../Utils/Math/Flow SRC_UTILS_FLOW)
aux_source_directory(../Utils/Geometry/Workspace SRC_UTILS_WORKSPACE)
aux_source_directory(../Utils/Geometry/Geometry2 SRC_UTILS_GEOMETRY2)
aux_source_directory(../Utils/Geometry/Collision SRC_UTILS_COLLISION)
aux_source_directory(../Utils/Geometry/Joints SRC_UTILS_JOINTS)
aux_source_directory(../Utils/Geometry/Joints/Plugin SRC_UTILS_JOINTS_PLUGINS)
aux_source_directory(../Utils/DataStructures/Proximity/LinearProximity SRC_UTILS_PROXIMITY_LINEAR)
aux_source_directory(../Utils/DataStructures/Proximity/RandomProximity SRC_UTILS_PROXIMITY_RANDOM)
aux_source_directory(../Utils/DataStructures/Proximity/GNATProximity SRC_UTILS_PROXIMITY_GNAT)
aux_source_directory(../Utils/DataStructures/Hash SRC_HASH)
aux_source_directory(../Utils/DataStructures/Graph SRC_GRAPH)
aux_source_directory(../Utils/DataStructures/SearchGraph SRC_SEARCH_GRAPH)
aux_source_directory(../Utils/DataStructures/ChainTree SRC_CHAIN_TREE)

if(PQP_FOUND)
  aux_source_directory(../Utils/Geometry/Collision/PQPCollisionDetector SRC_PQP_COLLISION_DETECTOR)
endif(PQP_FOUND)

set(AUX_COMPLETE_SRC_UTILS
	${SRC_UTILS_GENERAL} ${SRC_UTILS_GENERAL_BBOX} ${SRC_UTILS_XML} ${SRC_UTILS_TOPOLOGY}
	${SRC_UTILS_FLOW} ${SRC_UTILS_WORKSPACE} ${SRC_UTILS_GEOMETRY2} ${SRC_UTILS_COLLISION}
	${SRC_UTILS_PROXIMITY_LINEAR} ${SRC_UTILS_PROXIMITY_RANDOM}	${SRC_UTILS_PROXIMITY_GNAT}
	${SRC_PQP_COLLISION_DETECTOR} ${SRC_HASH} ${SRC_GRAPH} ${SRC_SEARCH_GRAPH}
	${SRC_CHAIN_TREE} ${SRC_UTILS_JOINTS} ${SRC_UTILS_JOINTS_PLUGINS}
	CACHE INTERNAL "OOPSMPUtils -- source files" FORCE)
set(COMPLETE_SRC_UTILS ${AUX_COMPLETE_SRC_UTILS} CACHE INTERNAL "OOPSMPUtils -- source files" FORCE)

add_library(OOPSMPUtils SHARED ${COMPLETE_SRC_UTILS})

if(EXTERNAL_LIBS)
    target_link_libraries(OOPSMPUtils ${EXTERNAL_LIBS})
endif(EXTERNAL_LIBS)

find_library(DL_LIB dl) 
if(DL_LIB)
	target_link_libraries(OOPSMPUtils ${DL_LIB})
endif(DL_LIB)  

OOPSMP_INSTALL_LIB(OOPSMPUtils)
